package com.itcs.app.service.impl;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.itcs.app.service.TransJournalService;
import com.itcs.trading.mapper.TransJournalMapper;
import com.itcs.trading.model.TransJournal;

/**
 * 交易流水表服务实现
 * @author LiuPeng
 * @date 2018年3月4日
 *  
 */
@Service("transJournalService")
public class TransJournalServiceImpl implements TransJournalService{

	@Autowired
	private TransJournalMapper transJournalMapper;
	
	@Override
	public TransJournal selectByTransNo(String transNo) {
		Date createDate = TransJournal.getDateByTransNo(transNo);
		if(createDate==null) {
			return null;
		}
		TransJournal transJournal = new TransJournal();
		transJournal.setTransNo(transNo);
		transJournal.setCreateTime(createDate);
		
		return transJournalMapper.selectByTransNoAndCreateTime(transJournal);
	}

}
